<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/myblog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/myblog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/myblog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/myblog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/myblog/css/main.css">


<link rel="stylesheet" href="/myblog/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/myblog/lib/pace/pace-theme-minimal.min.css">
  <script src="/myblog/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gao-qianwei.gitee.io","root":"/myblog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="一、MapReduce简介1.1、MapReduce产生背景&amp;ensp;&amp;ensp;&amp;ensp;&amp;ensp;海量数据在单机上处理因为硬件资源限制，无法胜任，而一旦将单机版程序扩展到集群来分布式运行，将极大增加程序的复杂度和开发难度，引入mapreduce框架后，开发人员可以将绝大部分工作集中在业务逻辑的开发上，而将分布式计算中的复杂性交由框架来处理。">
<meta property="og:type" content="article">
<meta property="og:title" content="MapReduce概述">
<meta property="og:url" content="https://gao-qianwei.gitee.io/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="一、MapReduce简介1.1、MapReduce产生背景&amp;ensp;&amp;ensp;&amp;ensp;&amp;ensp;海量数据在单机上处理因为硬件资源限制，无法胜任，而一旦将单机版程序扩展到集群来分布式运行，将极大增加程序的复杂度和开发难度，引入mapreduce框架后，开发人员可以将绝大部分工作集中在业务逻辑的开发上，而将分布式计算中的复杂性交由框架来处理。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gao-qianwei.gitee.io/myblog/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/Blog/source/_posts/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/1.png">
<meta property="og:image" content="https://gao-qianwei.gitee.io/myblog/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/2.png">
<meta property="article:published_time" content="2021-06-06T10:17:17.696Z">
<meta property="article:modified_time" content="2021-06-06T10:22:58.265Z">
<meta property="article:author" content="高乾威">
<meta property="article:tag" content="数据研发">
<meta property="article:tag" content="Hadoop">
<meta property="article:tag" content="MapReduce">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gao-qianwei.gitee.io/myblog/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/Blog/source/_posts/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/1.png">

<link rel="canonical" href="https://gao-qianwei.gitee.io/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>MapReduce概述 | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/myblog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/myblog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/myblog/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/myblog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/myblog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/myblog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-links">

    <a href="/myblog/links/" rel="section"><i class="fa fa-link fa-fw"></i>友链</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gao-qianwei.gitee.io/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/myblog/images/avatar.png">
      <meta itemprop="name" content="高乾威">
      <meta itemprop="description" content="报我楼成秋望月，把君诗读夜回灯">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          MapReduce概述
        </h1>

        <div class="post-meta">

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-06-06 18:17:17 / 修改时间：18:22:58" itemprop="dateCreated datePublished" datetime="2021-06-06T18:17:17+08:00">2021-06-06</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/%E6%95%B0%E6%8D%AE%E7%A0%94%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">数据研发</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/%E6%95%B0%E6%8D%AE%E7%A0%94%E5%8F%91/Hadoop/" itemprop="url" rel="index"><span itemprop="name">Hadoop</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/%E6%95%B0%E6%8D%AE%E7%A0%94%E5%8F%91/Hadoop/MapReduce/" itemprop="url" rel="index"><span itemprop="name">MapReduce</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <span class="post-meta-divider">|</span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h3 id="一、MapReduce简介"><a href="#一、MapReduce简介" class="headerlink" title="一、MapReduce简介"></a>一、MapReduce简介</h3><h4 id="1-1、MapReduce产生背景"><a href="#1-1、MapReduce产生背景" class="headerlink" title="1.1、MapReduce产生背景"></a>1.1、MapReduce产生背景</h4><p>&ensp;&ensp;&ensp;&ensp;海量数据在单机上处理因为硬件资源限制，无法胜任，而一旦将单机版程序扩展到集群来分布式运行，将极大增加程序的复杂度和开发难度，引入mapreduce框架后，开发人员可以将绝大部分工作集中在业务逻辑的开发上，而将分布式计算中的复杂性交由框架来处理。</p>
<span id="more"></span>

<h4 id="1-2、MapReduce"><a href="#1-2、MapReduce" class="headerlink" title="1.2、MapReduce"></a>1.2、MapReduce</h4><ol>
<li> MapReduce 是一个分布式运算程序的编程框架，是用户开发“基于 Hadoop 的数据分析应用”的核心框架。 </li>
<li> MapReduce 核心功能是将用户编写的业务逻辑代码和自带默认组件整合成一个完整的分布式运算程序，并发运行在一个 Hadoop 集群上。</li>
<li> MapReduce以一种可靠的，具有容错能力的方式并行地处理上TB级别的海量数据集。主要用于搜索领域，解决海量数据的计算问题。</li>
<li> MapReduce有两个阶段组成：Map和Reduce，用户只需实现map()和reduce()两个函数，即可实现分布式计算。</li>
</ol>
<blockquote>
<p>  关键词：编程框架、并行处理、可靠且容错、大规模集群、海量数据集</p>
</blockquote>
<h3 id="二、MapReduce优缺点"><a href="#二、MapReduce优缺点" class="headerlink" title="二、MapReduce优缺点"></a>二、MapReduce优缺点</h3><h4 id="2-1-优点"><a href="#2-1-优点" class="headerlink" title="2.1 优点"></a>2.1 优点</h4><ol>
<li> MapReduce 易于编程 它简单的实现一些接口，就可以完成一个分布式程序，这个分布式程序可以分布到大量 廉价的 PC 机器上运行。也就是说你写一个分布式程序，跟写一个简单的串行程序是一模一 样的。就是因为这个特点使得 MapReduce 编程变得非常流行。</li>
<li> 良好的扩展性 当你的计算资源不能得到满足的时候，你可以通过简单的增加机器来扩展它的计算能力。</li>
<li> 高容错性 MapReduce 设计的初衷就是使程序能够部署在廉价的 PC 机器上，这就要求它具有很高 的容错性。比如其中一台机器挂了，它可以把上面的计算任务转移到另外一个节点上运行， 不至于这个任务运行失败，而且这个过程不需要人工参与，而完全是由 Hadoop 内部完成的。 </li>
<li> 适合 PB 级以上海量数据的离线处理 可以实现上千台服务器集群并发工作，提供数据处理能力。 </li>
</ol>
<h4 id="2-2-缺点"><a href="#2-2-缺点" class="headerlink" title="2.2 缺点"></a>2.2 缺点</h4><ol>
<li> 不擅长实时计算，无法像 MySQL 一样，在毫秒或者秒级内返回结果。 </li>
<li> 不擅长流式计算，流式计算的输入数据是动态的，而 MapReduce 的输入数据集是静态的，不能动态变化。 这是因为 MapReduce 自身的设计特点决定了数据源必须是静态的。 </li>
<li> 不擅长 DAG（有向无环图）计算，多个应用程序存在依赖关系，后一个应用程序的输入为前一个的输出。在这种情况下， MapReduce 并不是不能做，而是使用后，每个 MapReduce 作业的输出结果都会写入到磁盘， 会造成大量的磁盘 IO，导致性能非常的低下。</li>
</ol>
<h3 id="三、MapReduce-核心编程思想"><a href="#三、MapReduce-核心编程思想" class="headerlink" title="三、MapReduce 核心编程思想"></a>三、MapReduce 核心编程思想</h3><img src="/myblog/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/Blog/source/_posts/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/1.png" alt="image-20210524233824290" style="zoom: 67%;">

<p>（1）分布式的运算程序往往需要分成至少 2 个阶段。 </p>
<p>（2）第一个阶段的 MapTask 并发实例，完全并行运行，互不相干。 </p>
<p>（3）第二个阶段的 ReduceTask 并发实例互不相干，但是他们的数据依赖于上一个阶段 的所有 MapTask 并发实例的输出。 </p>
<p>（4）MapReduce 编程模型只能包含一个 Map 阶段和一个 Reduce 阶段，如果用户的业 务逻辑非常复杂，那就只能多个 MapReduce 程序，串行运行。</p>
<h3 id="四、MapReduce-进程"><a href="#四、MapReduce-进程" class="headerlink" title="四、MapReduce 进程"></a>四、MapReduce 进程</h3><p>一个完整的 MapReduce 程序在分布式运行时有三类实例进程： </p>
<ol>
<li> MrAppMaster：负责整个程序的过程调度及状态协调。 </li>
<li> MapTask：负责 Map 阶段的整个数据处理流程。 </li>
<li> ReduceTask：负责 Reduce 阶段的整个数据处理流程。</li>
</ol>
<h3 id="五、MR程序运行流程"><a href="#五、MR程序运行流程" class="headerlink" title="五、MR程序运行流程"></a>五、MR程序运行流程</h3><img src="/myblog/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E6%A6%82%E8%BF%B0/2.png" alt="image-20210524234251631" style="zoom:50%;">

<ol>
<li> 一个mr程序启动的时候，最先启动的是MRAppMaster，MRAppMaster启动后根据本次job的描述信息，计算出需要的maptask实例数量，然后向集群申请机器启动相应数量的maptask进程</li>
<li>maptask进程启动之后，根据给定的数据切片范围进行数据处理，主体流程为：<ul>
<li>  利用客户指定的inputformat来获取RecordReader读取数据，形成输入KV对</li>
<li>  将输入KV对传递给客户定义的map()方法，做逻辑运算，并将map()方法输出的KV对收集到缓存</li>
<li>  将缓存中的KV对按照K分区排序后不断溢写到磁盘文件</li>
</ul>
</li>
<li> MRAppMaster监控到所有maptask进程任务完成之后，会根据客户指定的参数启动相应数量的reducetask进程，并告知reducetask进程要处理的数据范围（数据分区）</li>
<li> Reducetask进程启动之后，根据MRAppMaster告知的待处理数据所在位置，从若干台maptask运行所在机器上获取到若干个maptask输出结果文件，并在本地进行重新归并排序，然后按照相同key的KV为一个组，调用客户定义的reduce()方法进行逻辑运算，并收集运算输出的结果KV，然后调用客户指定的outputformat将结果数据输出到外部存储</li>
</ol>
<h3 id="六、常用数据序列化类型"><a href="#六、常用数据序列化类型" class="headerlink" title="六、常用数据序列化类型"></a>六、常用数据序列化类型</h3><table>
<thead>
<tr>
<th align="center">Java 类型</th>
<th align="center">Hadoop Writable 类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">Boolean</td>
<td align="center">BooleanWritable</td>
</tr>
<tr>
<td align="center">Byte</td>
<td align="center">ByteWritable</td>
</tr>
<tr>
<td align="center">Int</td>
<td align="center">IntWritable</td>
</tr>
<tr>
<td align="center">Float</td>
<td align="center">FloatWritable</td>
</tr>
<tr>
<td align="center">Long</td>
<td align="center">LongWritable</td>
</tr>
<tr>
<td align="center">Double</td>
<td align="center">DoubleWritable</td>
</tr>
<tr>
<td align="center"><strong>String</strong></td>
<td align="center"><strong>Text</strong></td>
</tr>
<tr>
<td align="center">Map</td>
<td align="center">MapWritable</td>
</tr>
<tr>
<td align="center">Array</td>
<td align="center">ArrayWritable</td>
</tr>
<tr>
<td align="center">Null</td>
<td align="center">NullWritable</td>
</tr>
</tbody></table>
<h3 id="七、MapReduce-编程规范"><a href="#七、MapReduce-编程规范" class="headerlink" title="七、MapReduce 编程规范"></a>七、MapReduce 编程规范</h3><p>&ensp;&ensp;&ensp;&ensp;用户编写的程序分成三个部分：Mapper、Reducer 和 Driver。</p>
<h4 id="7-1-Mapper阶段"><a href="#7-1-Mapper阶段" class="headerlink" title="7.1 Mapper阶段"></a>7.1 Mapper阶段</h4><p>（1）用户自定义的Mapper要继承自己的父类 </p>
<p>（2）Mapper的输入数据是KV对的形式（KV的类型可自定义） </p>
<p>（3）Mapper中的业务逻辑写在map()方法中 </p>
<p>（4）Mapper的输出数据是KV对的形式（KV的类型可自定义） </p>
<p>（5）map()方法（MapTask进程）对每一个调用一次</p>
<h4 id="7-2-Reducer阶段"><a href="#7-2-Reducer阶段" class="headerlink" title="7.2 Reducer阶段"></a>7.2 Reducer阶段</h4><p>（1）用户自定义的Reducer要继承自己的父类</p>
<p>（2）Reducer的输入数据类型对应Mapper的输出数据类型，也是KV </p>
<p>（3）Reducer的业务逻辑写在reduce()方法中 </p>
<p>（4）ReduceTask进程对每一组相同 &lt;k，v&gt; 的组调用一次reduce()方法 </p>
<h4 id="7-3-Driver阶段"><a href="#7-3-Driver阶段" class="headerlink" title="7.3 Driver阶段"></a>7.3 Driver阶段</h4><p>    相当于YARN集群的客户端，用于提交我们整个程序到YARN集群，提交的是封装了MapReduce程序相关运行参数的job对象。</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/myblog/tags/%E6%95%B0%E6%8D%AE%E7%A0%94%E5%8F%91/" rel="tag"># 数据研发</a>
              <a href="/myblog/tags/Hadoop/" rel="tag"># Hadoop</a>
              <a href="/myblog/tags/MapReduce/" rel="tag"># MapReduce</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/myblog/2021/05/29/%E7%AE%97%E6%B3%95%E4%B8%8E%E6%95%B0%E7%BB%84%EF%BC%9A%E6%95%B0%E7%BB%84%E4%B8%AD%E7%9A%84%E7%AC%ACK%E4%B8%AA%E6%9C%80%E5%A4%A7%E5%85%83%E7%B4%A0/" rel="prev" title="数组中的第K个最大元素">
      <i class="fa fa-chevron-left"></i> 数组中的第K个最大元素
    </a></div>
      <div class="post-nav-item">
    <a href="/myblog/2021/06/06/Hadoop%E4%B9%8BMapReduce%EF%BC%9AMapReduce%E5%BA%8F%E5%88%97%E5%8C%96/" rel="next" title="MapReduce序列化">
      MapReduce序列化 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%80%E3%80%81MapReduce%E7%AE%80%E4%BB%8B"><span class="nav-text">一、MapReduce简介</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-1%E3%80%81MapReduce%E4%BA%A7%E7%94%9F%E8%83%8C%E6%99%AF"><span class="nav-text">1.1、MapReduce产生背景</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#1-2%E3%80%81MapReduce"><span class="nav-text">1.2、MapReduce</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BA%8C%E3%80%81MapReduce%E4%BC%98%E7%BC%BA%E7%82%B9"><span class="nav-text">二、MapReduce优缺点</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#2-1-%E4%BC%98%E7%82%B9"><span class="nav-text">2.1 优点</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-2-%E7%BC%BA%E7%82%B9"><span class="nav-text">2.2 缺点</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%89%E3%80%81MapReduce-%E6%A0%B8%E5%BF%83%E7%BC%96%E7%A8%8B%E6%80%9D%E6%83%B3"><span class="nav-text">三、MapReduce 核心编程思想</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9B%9B%E3%80%81MapReduce-%E8%BF%9B%E7%A8%8B"><span class="nav-text">四、MapReduce 进程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BA%94%E3%80%81MR%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E6%B5%81%E7%A8%8B"><span class="nav-text">五、MR程序运行流程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%AD%E3%80%81%E5%B8%B8%E7%94%A8%E6%95%B0%E6%8D%AE%E5%BA%8F%E5%88%97%E5%8C%96%E7%B1%BB%E5%9E%8B"><span class="nav-text">六、常用数据序列化类型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%83%E3%80%81MapReduce-%E7%BC%96%E7%A8%8B%E8%A7%84%E8%8C%83"><span class="nav-text">七、MapReduce 编程规范</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#7-1-Mapper%E9%98%B6%E6%AE%B5"><span class="nav-text">7.1 Mapper阶段</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#7-2-Reducer%E9%98%B6%E6%AE%B5"><span class="nav-text">7.2 Reducer阶段</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#7-3-Driver%E9%98%B6%E6%AE%B5"><span class="nav-text">7.3 Driver阶段</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="高乾威"
      src="/myblog/images/avatar.png">
  <p class="site-author-name" itemprop="name">高乾威</p>
  <div class="site-description" itemprop="description">报我楼成秋望月，把君诗读夜回灯</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/myblog/archives/">
        
          <span class="site-state-item-count">91</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/myblog/categories/">
          
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/myblog/tags/">
          
        <span class="site-state-item-count">59</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="http://github.com/GaoQianwei" title="GitHub → http:&#x2F;&#x2F;github.com&#x2F;GaoQianwei" rel="noopener" target="_blank">GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:2966807184@qq.com" title="E-Mail → mailto:2966807184@qq.com" rel="noopener" target="_blank">E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.zhihu.com/people/xue-wu-zhi-jing-75-22" title="知乎 → https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;xue-wu-zhi-jing-75-22" rel="noopener" target="_blank">知乎</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/weixin_45341339" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;weixin_45341339" rel="noopener" target="_blank">CSDN</a>
      </span>
  </div>



      </div><div>
  <canvas id="canvasDiyBlock" style="width:60%;">当前浏览器不支持canvas，请更换浏览器后再试</canvas>
<script src="/myblog/js/custom/clock.js"></script>

</div>


    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 2021-04 到 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">高乾威</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

<span class="post-meta-divider">|</span>

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">全站共 117.2k 字</span>
</div>

<span class="post-meta-divider">|</span>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/myblog/lib/anime.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.ui.min.js"></script>

<script src="/myblog/js/utils.js"></script>

<script src="/myblog/js/motion.js"></script>


<script src="/myblog/js/schemes/pisces.js"></script>


<script src="/myblog/js/next-boot.js"></script>


  <script defer src="/myblog/lib/three/three.min.js"></script>
    <script defer src="/myblog/lib/three/canvas_lines.min.js"></script>


  




  
<script src="/myblog/js/local-search.js"></script>













  

  

</body>
</html>
